package 数据结构.排序编程作业;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

/**
 * @author IT_Jay
 * @date 2021/12/8 3:00 PM
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int length = scanner.nextInt();
        List<Integer> list = new ArrayList<>();
        for (int i=0; i<s.length; i++){
            list.add(Integer.parseInt(s[i]));
        }
        list.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1 - o2;
            }
        });
        for (int i = 0; i<length; i++){
            System.out.print(list.get(i) + " ");
        }
    }
}
